package com.xwd.pojo;

import java.io.Serializable;
import java.util.List;

/**
 * @ClassName PageBean-分页对象
 * @Description: com.xwd.pojo
 * @Auther: xiwd
 * @Date: 2022/2/13 - 02 - 13 - 15:13
 * @version: 1.0
 */
public class PageBean<T> implements Serializable {
    private static final long serialVersionUID = 7826544493613877349L;
    //properties
    private List<T> list;//当前页的所有信息
    private Integer currentPage;//当前页
    private Integer pageSize;//页容量
    private Integer totalPage;//总页码数
    private Integer totalSize;//总的记录数
    //setter
    public void setList(List<T> list) {
        this.list = list;
    }

    public void setCurrentPage(Integer currentPage) {
        this.currentPage = currentPage;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public void setTotalPage(Integer totalPage) {
        this.totalPage = totalPage;
    }

    public void setTotalSize(Integer totalSize) {
        this.totalSize = totalSize;
    }

    //getter
    public List<T> getList() {
        return list;
    }

    public Integer getCurrentPage() {
        return currentPage;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public Integer getTotalPage() {
        return totalPage;
    }

    public Integer getTotalSize() {
        return totalSize;
    }
    //constructors

    public PageBean() {
        this(null,null,null,null,null);
    }

    public PageBean(List<T> list, Integer currentPage, Integer pageSize, Integer totalPage, Integer totalSize) {
        super();
        this.list = list;
        this.currentPage = currentPage;
        this.pageSize = pageSize;
        this.totalPage = totalPage;
        this.totalSize = totalSize;
    }
    //methods

    @Override
    public String toString() {
        return "PageBean{" +
                "list=" + list +
                ", currentPage=" + currentPage +
                ", pageSize=" + pageSize +
                ", totalPage=" + totalPage +
                ", totalSize=" + totalSize +
                '}';
    }
}
